package com.xiaoyao.wblog.component;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import android.os.Handler;
import android.os.Message;
import android.widget.ListView;

public class PullRefreshHandler extends Handler {

	private PullRefreshListView mPullRefreshListView;

	public PullRefreshHandler(PullRefreshListView pullRefreshListView) {
		mPullRefreshListView = pullRefreshListView;
	}

	@Override
	public void handleMessage(Message msg) {
		super.handleMessage(msg);
		mPullRefreshListView.smoothScrollToPosition(0);

		// try {
		//
		// Class[] parameterTypes = new Class[1];
		// parameterTypes[0] = Integer.TYPE;
		// Method _Method = ListView.class.getMethod("smoothScrollToPosition",
		// parameterTypes);
		// Object[] args = new Object[1];
		// args[0] = Integer.valueOf(0);
		// _Method.invoke(mPullRefreshListView, args);
		// return;
		// } catch (SecurityException e) {
		// e.printStackTrace();
		// } catch (NoSuchMethodException e) {
		// e.printStackTrace();
		// } catch (IllegalArgumentException e) {
		// e.printStackTrace();
		// } catch (IllegalAccessException e) {
		// e.printStackTrace();
		// } catch (InvocationTargetException e) {
		// e.printStackTrace();
		// }

	}

}
